import { ElMessage, ElMessageBox } from "element-plus"

export const openConfirmBox = (msg : string,confirm : Function) => {
    ElMessageBox.confirm(
      msg,
      '警告',
      {
        confirmButtonText: '确认',
        cancelButtonText: '取消',
        type: 'warning',
      }
    )
      .then(() => {
        confirm()
      })
      .catch(() => {
        ElMessage.info("已取消操作")
      })
  }